package com.yamed.bus.dal.dao;

import com.yamed.bus.dal.entity.PromoteApkConfig;
import com.yamed.bus.web.vo.PromoteApkCountVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


@Mapper
public interface PromoteApkConfigDao {
    /**
     * 保存推广配置
     * @param promoteApkConfig
     * @return
     */
    Integer saveRecord(PromoteApkConfig promoteApkConfig);

    /**
     * 更新推广配置
     * @param promoteApkConfig
     * @return
     */
    Integer updateRecord(PromoteApkConfig promoteApkConfig);

    /**
     * 查询推广配置列表
     * @param promoteCode
     * @return
     */
    List<PromoteApkConfig> getList(@Param("promoteCode") String promoteCode);

    /**
     * 查询推广配置转化列表
     * @param promoteCode
     * @return
     */
    List<PromoteApkCountVO> getTransList(@Param("promoteCode") String promoteCode);


    /**
     * 查询推广配置
     * @param promoteUrl
     * @return
     */
    PromoteApkConfig getByPromoteUrl(@Param("promoteUrl") String promoteUrl);

    /**
     * 查询推广配置
     * @param promoteCode
     * @return
     */
    PromoteApkConfig getByPromoteCode(@Param("promoteCode") String promoteCode);

    /**
     * 点击次数添加
     * @param id
     * @return
     */
    Integer addClickCount(@Param("id") Long id);

    /**
     * 下载次数添加
     * @param id
     * @return
     */
    Integer addDownloadCount(@Param("id") Long id);
}
